{extends file="layout.tpl"}
{block name="content"}
	<section>
		<div class="container">
			<div class="breadcrumbs">
				{$set_breadcrumb}
			</div>
			<div class="row">
				<div class="col-sm-3">
					<div class="left-sidebar">
						<h2>Danh mục</h2>
						<!--category-productsr-->
						{include 'box/box_categories.tpl'}
						<!--/category-productsr-->
						<div class="brands_products"><!--brands_products-->
							<h2>Cách nấu</h2>
							{include 'box/box_categories_style.tpl'}
						</div><!--/brands_products-->
						<div class="shipping text-center"><!--shipping-->
							<img src="/images/banner/shipping.jpg" alt="MonGiNgon.vn" />
						</div><!--/shipping-->
					</div>
				</div>
				<div class="col-sm-9 padding-right">
					<h2 class="title text-center">Thông tin chi tiết</h2>
					{if $dish}
					<div class="product-details" itemscope itemtype="http://schema.org/Recipe"><!--product-details-->
						<div class="col-sm-6">
							<div class="view-product">
								<img src="{url}{$dish.image1}" alt="{$dish.title}" itemprop="image"/>
							</div>
							<div class="highlight">
								<strong itemprop="recipeInstructions">{$dish.introtext}</strong>
							</div>
						</div>
						<div class="col-sm-6">
							<div class="product-information"><!--/product-information-->
								{if $dish.new}
								<img src="/images/icon/new.jpg" class="newarrival" alt="dish new"/>
								{/if}
								<h1 itemprop="name">{$dish.title}</h1>
								<p>
									{if isset($user.name)}
									<a href="{$user.link}" rel="nofollow" target="_blank" title="Đăng bởi {$user.name}" itemprop="author">
										<img src="https://graph.facebook.com/{$user.id}/picture?type=square" alt ="Đăng bởi {$user.name}">
										 {$user.name}
									</a>
									{else}
									<a href="{url}" target="_blank" title="Đăng bởi MonGiNgon" itemprop="author">
										MonGiNgon
									</a>
									{/if}
								</p>
								<ul>
									<li title="Ngày đăng {$dish.date}" itemprop="datePublished" content="{$dish.created}">
										<i class="fa fa-calendar-o"></i> {$dish.date}
									</li>
									<li title="Lượt xem {$dish.view}">
										<i class="fa fa-eye"></i> <span>{$dish.view}</span>
									</li>
								</ul>
								<div class="bs-glyphicons">
									<ul class="bs-glyphicons-list">
										<li data-toggle="tooltip" data-placement="bottom" title="Thời gian chuẩn bị {$dish.prepTime}p">
											<span class="glyphicon glyphicon-time"></span>
											<span class="glyphicon-class">
											Thời gian chuẩn bị <b>{$dish.prepTime}p</b>
											</span>
											<time id="timePrep" itemprop="prepTime" datetime="PT{$dish.prepTime}M"></time>
										</li>
									  
										<li title="Thời gian thực hiện {$dish.cookTime}p">
											<span class="glyphicon glyphicon-dashboard"></span>
											<span class="glyphicon-class">
												Thời gian thực hiện <b>{$dish.cookTime}p</b>
											</span>
											<time id="timeCook" itemprop="cookTime" datetime="PT{$dish.cookTime}M"></time>
										</li>
									  
										<li title="Khẩu phần {$dish.recipeYield} người">
											<span class="glyphicon glyphicon-user"></span>
											<span class="glyphicon-class">
												Khẩu phần <b itemprop="recipeYield">{$dish.recipeYield}</b> người
											</span>
										</li>
										<li title="Đánh giá {$dish.rank}/5">
											<span class="glyphicon glyphicon-heart"></span>
											<span class="glyphicon-class">Đánh giá <b>3</b>/5</span>
										</li>
										<div itemprop="aggregateRating" itemscope="" itemtype="http://schema.org/AggregateRating">
											<meta itemprop="ratingValue" content="3">
											<meta itemprop="reviewCount" content="{$dish.view}">
										</div>
									</ul>
								</div>
								<div class="facebook">
									<div class="fb-like" data-share="true" data-width="300" data-show-faces="true">
									</div>
								</div>
							</div><!--/product-information-->
						</div>
						<div class="col-sm-12">
							<div class="stocks">
								<h3>Nguyên liệu gồm :</h3>
								<div class="list-group">
									{foreach $dish.stocks as $d => $item}
									<a href="javascript:void(0)" title="{$item.stock}" class="list-group-item" itemprop="ingredients">{$d+1}. {$item.stock|ucfirst} {$item.count}</a>
									{/foreach}
								</div>
							</div>
							<div class="steps">
								<h3>Thực hiện :</h3>
								{foreach $dish.steps as $d => $item}
								<div class="step">
									<div class="panel panel-default">
										<div class="panel-body">
											<strong>
												Bước {$d+1}
											</strong>
											{if $item.image}
											<img itemprop="image" class="img-responsive" src="{url path=$item.image}" alt="{$item.comment}">
											{/if}
										</div>
										<div class="panel-footer">
											<span itemprop="recipeInstructions">{$item.comment|ucfirst}</span>
										</div>
									</div>
								</div>
								{/foreach}
								<div class="step">
									<div class="panel panel-default">
										<div class="panel-body">
											<strong>MonGiNgon.vn</strong>
											{if $dish.fulltext}
											<div class="alert alert-info" role="alert">{$dish.fulltext}</div>
											{/if}
										</div>
										<div class="panel-footer">
											<p>
												Như vậy là bạn đã hoàn thành {$dish.title}, <b>MonGiNgon.vn</b> Chúc các bạn thành công và ngon miệng!
											</p>
											<div class="facebook">
												<div class="fb-like" data-share="true" data-width="300" data-show-faces="true">
												</div>
											</div>
										</div>
									</div>
								</div>
								<section>
								{if $tags}
									<ul class="pager">
									{foreach from=$tags item=v}
										<li><a href="{url}tag/{$v.value}" rel="tag">{$v.name}</a></li>
									{/foreach}
									</ul>
								{/if}
								</section>
								<div class="step">
									<div class="fb-comments" data-href="{$dish.link}" data-width="100%" data-numposts="5" data-colorscheme="light"></div>
								</div>
							</div>
						</div>
					</div><!--/product-details-->

					{if $other_dish|@count gt 3}
					<!--recommended_items-->
					<div class="recommended_items">
						<h2 class="title text-center">Gợi Ý Món Ngon</h2>
						
						<div id="recommended-item-carousel" class="carousel slide" data-ride="carousel">
							<div class="carousel-inner">
								{foreach from=$other_dish key=k item=v}
									{if $v@first}
									<div class="item active">
									{elseif {math equation="x % 3" x= $k} == 0}
									</div>
									<div class="item">
									{/if}
									<div class="col-sm-4">
										<div class="product-image-wrapper">
											<div class="single-products">
												<div class="productinfo text-center">
													<img src="{url}{$v.image1}" alt="{$v.title}" />
													<h2>{$v.title}</h2>
													<a href="{$v.link}" class="btn btn-default add-to-cart"><i class="fa fa-hand-o-up"></i> Xem ngay</a>
												</div>
											</div>
										</div>
									</div>
									{if $v@last}
									</div>
									{/if}
								{/foreach}
							</div>
							<a class="left recommended-item-control" href="#recommended-item-carousel" data-slide="prev">
								<i class="fa fa-angle-left"></i>
							</a>
							<a class="right recommended-item-control" href="#recommended-item-carousel" data-slide="next">
								<i class="fa fa-angle-right"></i>
							</a>
						</div>
					</div>
					<!--/recommended_items-->
					{/if}
				{else}
					<div class="alert alert-warning" role="alert">
						Chúng tôi không tìm thấy bài viết này !!! về
						<a href="{url}"> Trang chủ</a>
					</div>
				{/if}
				{if $data_tab|@count gt 0}
					<div class="category-tab"><!--category-tab-->
						<div class="col-sm-12">
							<ul class="nav nav-tabs">
							{foreach from=$data_tab key=k item=v}
								{if $v.sub|@count gt 4}
									<li {if $v@first} class="active"{/if}>
										<a href="#{$v.alias}" data-toggle="tab">{$v.name}</a>
									</li>
								{/if}
							{/foreach}
							</ul>
						</div>
						<div class="tab-content">
							{foreach from=$data_tab key=k item=v}
								{if $v.sub|@count gt 4}
								<div class="tab-pane fade {if $v@first} active{/if} in" id="{$v.alias}" >
									{foreach from=$v.sub item=dish}
									<div class="col-sm-3">
										<div class="product-image-wrapper">
											<div class="single-products">
												<div class="productinfo text-center style2">
													<a href="{$dish.link}">
														<img src="{url}{$dish.image1}" class="image-small" alt="{$dish.title}" />
														<h2 >{$dish.title}</h2>
													</a>
													<a href="{$dish.link}" class="btn btn-default add-to-cart"><i class="fa fa-hand-o-up"></i> Nấu ngay</a>
												</div>
											</div>
										</div>
									</div>
									{/foreach}
								</div>
								{/if}
							{/foreach}
						</div>
					</div><!--/category-tab-->
				{/if}
				</div>
			</div>
		</div>
	</section>
{/block}
